######################################
#
######################################
#source file
#源文件，自动找所有.c和.cpp文件，并将目标定义为同名.o文件
DIR_INC	:= ./include/

DIR_SRC	:= ./source/


SOURCE  += $(wildcard *.cpp)
OBJS    := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))
  
#target you can change test to what you want
#目标文件名，输入任意你想要的执行文件名
TARGET  := TSTC_USBCma_L_VIEW
  
#compile and lib parameter
#编译参数
CXX      := g++
#CXX      := /usr/bin/arm-linux-gnueabihf-g++
LIBS    := -L ./lib/aarch64/static -ltstc_usbcam -ludev -pthread
LDFLAGS :=
DEFINES := -D _GLIBCXX_USE_CXX11_ABI=0
INCLUDE := -I.
CFLAGS  := -g -Wall -O3 $(DEFINES) $(INCLUDE) -fPIC
CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H
  
  
#i think you should do anything here
#下面的基本上不需要做任何改动了
.PHONY : everything objs clean veryclean rebuild
  
everything : $(TARGET)
  
all : $(TARGET)

objs : $(OBJS)
  
rebuild: veryclean everything
                
clean :
	rm -fr *.so
	rm -fr *.o
	rm -fr $(OBJS)
	
    
veryclean : clean
	rm -fr $(TARGET)
  
$(TARGET) : $(OBJS)
	$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
